﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ChoViet.CMS.ViewModels.LoadAdByConditionViewModle>" %>
<%@ Import Namespace="ChoViet.Lib.Common"%>
<%@ Import Namespace="ChoViet.Lib.Helpers" %>
<%  
    foreach (var item in Model.Ads)
	{%>
<div class="content-item-condition">
            <%var LinkTodetails = Html.AdDetailRoute(item); %>
            <div style="float:left; padding-right:5px">
                <a href="<%=LinkTodetails%>"><img style="border: 1px solid #DFDFDF;" class="avatar" width="60" height="40" src="<%=LinkUtils.UrlImageOrDefault(item.Image)%>" /></a>
            </div>
                <a href="<%=LinkTodetails%>"><%= Html.Encode(item.Title.Length > 200 ? item.Title.Substring(0, 200) + "..." : item.Title)%><%=Utils.CheckNewAdToDay(item.ModifyDate.Value)%></a>
                <div class="clear"></div>
                <div class="info">
                    <span class="hightlight"><%=Utils.DateTimeToStringFormat(item.ModifyDate.Value)%>..</span>
                    Lượt xem:<span class="hightlight" style="color:#EC1C24"><%= string.IsNullOrEmpty(item.ViewNumber.ToString()) ? 0 : item.ViewNumber %>..</span>
                    <div style="float:right; margin-right:15px;">Tại: <span class="hightlight"><%= Html.Encode(item.DistrictID != null ? item.City.Districts.FirstOrDefault(e => e.ID == item.DistrictID).Name + " - " + item.City.Name : item.City.Name)%></span></div>     
                </div>
        <div class="clear"></div>
     </div>
     <hr style="border-bottom: 1px solid #FF6600; margin:5px 0px 10px 0px;">
<% }%>

